<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>键盘事件</title>
    <script type="text/javascript" src="../js/vue.js"></script>

</head>
<body>
<!--准备一个容器-->
<!--vue常用按键别名
enter
delete
esc
space
tab换行
down
left
right
-->
<div id="root">
    <h2>欢迎来到{{name}}！！！</h2>
    <input type="text" placeholder="按下回车提示" @keyup.tab="showInfo">
</div>
</body>
<script type="text/javascript">
    Vue.config.productionTip=false

    const nz=new Vue({
        el:"#root",
        data:{
            name:'楠籽'
        },
        methods:{
            showInfo(e){
               // console.log(e.key,e.keyCodes)
                console.log(e.target.value)
            }
        },
    })
</script>
</html>